package Help;

import dao.emailDao;
import domain.email;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.io.PrintWriter;

public class demo extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        PrintWriter out = response.getWriter();
        String email = request.getParameter("Email");
        domain.email t=new email();
        t.setEmailStr(email);
        emailDao dao=new emailDao();
        email res=dao.Query(t);
        if(res!=null){
            out.write("The information has been queried in the database");
        }else{
            out.write("There is no record");
        }

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request,response);
    }
}
